<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<html>
<head>
   <script type="text/javascript">


       function f1() {
           console.log($('[name=username]').val())
           //[name^=value] 节点必须有name属性，其值为'value'开始
           $('[name^=user]').css('background-color','green')
           //[name$=value] 节点必须有name属性，其值为'value'结尾
           $('[name$=fuck1]').css('background-color','red')
           //[name!=value] 节点如果有name属性，则其值不等于value
           $('[class!=blue]').css('background-color','orange')
           //需要取到的节点要求:有class属性，并且属性值不等于'orange'
           //$(s1s2s3)满足s1 s2 s3等多个条件
           $('[class][class!=blue]').css('background-color','purple')
           console.log($('.ai').html())

           //需要取到的节点要求:有class属性，其值要有value字样
           $('[class*=we]').css('background-color',' PINK')
           $('[class]input[value^=t][name*=a]').css('font-size','30px')
       }
       function f2() {
       }

       function f3() {
       }

   </script>
    <style type="text/css">

    </style>
</head>
<body>
    <h2 class="blue ai">属性选择器</h2>
    <input type="text" name="username" value="tom">
    <input type="text" name="userfuck" value="tom">
    <input type="text" name="abcfuck1" value="tom">
    <input type="text" name="efdfuck1" value="tom">
    <input type="text" class="blue" name="efdfuck1" value="tom1">
    <input type="text" class="ssai1" name="efdfuck1" value="tom1">
    <input type="text" class="eweddd" name="aefdfuck1" value="tomss">
    <input type="button" value="触发" onclick="f1()">
</body>
</html>
